Process Analysis Toolkit (PAT) 3.5 Help |
In this example, buyer communicates with the seller through the service
channel B2S to invoke its service, while channel Bch is a private channel for
the following session only. In the Session, the buyer firstly sends a message
QuoteRequest through channel Bch to the seller. The seller responds with some
quotation value x, which is a variable. First of all, we need to declare the service channels to be used in the
choreography or orchestration. If a service channel is used without declaration,
it will fail the parser. The following is the specification of choreography. Chor cBuySell {
} The choreography coordinates three roles (i.e.,Buyer,
Seller and Shipper) to complete a business transaction. At
line 1, the Buyer communicates with the Seller through service
channel B2S to invoke its service. Channel Bch which is sent
along the service invocation is to be used as a session channel for this session
only. In the Session, the Buyer firstly sends a message
QuoteRequest to the Seller through channel Bch. At
line 3, the Seller responds with some quotation value x, which
is a variable. Notice that in choreography, the value of x may be left
unspecified at this point. At line 7, the Seller sends a message
through the service channel S2H to invoke a shipping service. Notice
that the channel Bch is passed onto the Shipper so that the
shipper may contact the Buyer directly. At line 8, the Shipper
sends delivery details to the Buyer and Seller through the
respective channels. The rest is self-explanatory. The following is the implementation of the orchstration. Each role is
implemented as a separate component. Each component contains variable
declarations (optional) and process definitions. We assume that the process
Main defines the computational logic of the role after initialization.
We remark that the orchestration generally contains more details than the
choreography, e.g., the variable counter in Buyer constraints
the number of attempts the buyer would try before giving up. Some properties that can be checked are the following: